if (this._clone.source)
this._clone.source.sync_visibility();
- let windowActor = this._window
- ? this._window.get_compositor_private() : null;
+ const windowActor = this._window?.get_compositor_private();
if (windowActor)
windowActor.hide();
_getWindows() {
let app = Shell.WindowTracker.get_default().focus_app;
- let appWindows = app ? app.get_windows() : [];
+ let appWindows = app?.get_windows() ?? [];
if (this._settings.get_boolean('current-workspace-only')) {
const workspaceManager = global.workspace_manager;
this._switcherooProxy = global.get_switcheroo_control();
if (this._switcherooProxy) {
let prop = this._switcherooProxy.get_cached_property('HasDualGpu');
- discreteGpuAvailable = prop ? prop.unpack() : false;
+ discreteGpuAvailable = prop?.unpack() ?? false;
} else {
discreteGpuAvailable = false;
}
if (allowAutorun)
this._allowAutorun(volume);
- let mountOp = operation ? operation.mountOp : null;
+ const mountOp = operation?.mountOp ?? null;
this._activeOperations.set(volume, operation);
volume.mount(0, mountOp, null,
_reaskPassword(volume) {
let prevOperation = this._activeOperations.get(volume);
- let existingDialog = prevOperation ? prevOperation.borrowDialog() : null;
+ const existingDialog = prevOperation?.borrowDialog();
let operation =
new ShellMountOperation.ShellMountOperation(volume,
{ existingDialog });
}
const prop = plugin.lookup_property('GNOME', 'supports-external-ui-mode');
- const trimmedProp = prop ? prop.trim().toLowerCase() : '';
+ const trimmedProp = prop?.trim().toLowerCase() ?? '';
return {
fileName,
let userAvatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE });
userAvatar.update();
- userName = session.user.get_real_name()
- ? session.user.get_real_name() : session.username;
+ userName = session.user.get_real_name() ?? session.username;
let userLabelText;
if (session.remote)
this.getHours(),
this.getMinutes(),
this.getSeconds());
- return dt ? dt.format(format) : '';
+ return dt?.format(format) ?? '';
};
let slowdownEnv = GLib.getenv('GNOME_SHELL_SLOWDOWN_FACTOR');
}
_buildLayout() {
- let name = this._app ? this._app.get_name() : this._window.title;
+ const name = this._app?.get_name() ?? this._window.title;
let content = new Dialog.MessageDialogContent({
title: _('Allow inhibiting shortcuts'),
return source;
}
- let appId = ndata ? ndata.hints['desktop-entry'] || null : null;
+ const appId = ndata?.hints['desktop-entry'];
source = new FdoNotificationDaemonSource(title, pid, sender, appId);
this._sources.push(source);
});
}
- this._defaultAction = defaultAction ? defaultAction.unpack() : null;
+ this._defaultAction = defaultAction?.unpack();
this._defaultActionTarget = defaultActionTarget;
- this.update(title.unpack(), body ? body.unpack() : null,
+ this.update(title.unpack(), body?.unpack(),
{ gicon: gicon ? Gio.icon_deserialize(gicon) : null,
datetime: time ? GLib.DateTime.new_from_unix_local(time.unpack()) : null });
}
_getActionText(type, number) {
let str = global.display.get_pad_action_label(this.padDevice, type, number);
- return str ? str : _("None");
+ return str ?? _('None');
}
_updateActionLabels() {
if (this._followUpActionEdition(str))
return;
- this._padDiagram.stopEdition(false, str ? str : _("None"));
+ this._padDiagram.stopEdition(false, str ?? _('None'));
this._editedAction = null;
}
this._updateWindowsSection();
- let appInfo = app ? app.app_info : null;
- let actions = appInfo ? appInfo.list_actions() : [];
+ const appInfo = app?.app_info;
+ const actions = appInfo?.list_actions() ?? [];
this._actionSection.removeAll();
actions.forEach(action => {
Signals: { 'menu-set': {} },
}, class PanelMenuButton extends ButtonBox {
_init(menuAlignment, nameText, dontCreateMenu) {
- super._init({ reactive: true,
- can_focus: true,
- track_hover: true,
- accessible_name: nameText ? nameText : "",
- accessible_role: Atk.Role.MENU });
+ super._init({
+ reactive: true,
+ can_focus: true,
+ track_hover: true,
+ accessible_name: nameText ?? '',
+ accessible_role: Atk.Role.MENU,
+ });
if (dontCreateMenu)
this.menu = new PopupMenu.PopupDummyMenu(this);
}
getSensitive() {
- let parentSensitive = this._parent ? this._parent.sensitive : true;
+ const parentSensitive = this._parent?.sensitive ?? true;
return this._activatable && this._sensitive && parentSensitive;
}
}
getSensitive() {
- let parentSensitive = this._parent ? this._parent.sensitive : true;
+ const parentSensitive = this._parent?.sensitive ?? true;
return this._sensitive && parentSensitive;
}
return;
}
- let from = this._defaultResult ? this._defaultResult : null;
+ const from = this._defaultResult ?? null;
this.navigate_focus(from, direction, false);
}
if (deviceNode)
params['device-node'] = GLib.Variant.new('s', deviceNode);
- connection.emit_signal(destination,
- this._dbusImpl.get_object_path(),
- info ? info.name : null,
- 'AcceleratorActivated',
- GLib.Variant.new('(ua{sv})', [action, params]));
+ connection.emit_signal(
+ destination,
+ this._dbusImpl.get_object_path(),
+ info?.name ?? null,
+ 'AcceleratorActivated',
+ GLib.Variant.new('(ua{sv})', [action, params]));
}
_grabAcceleratorForSender(accelerator, modeFlags, grabFlags, sender) {
// FIXME: Fix num buttons
for (let i = 0; i < 50; i++) {
let str = display.get_pad_action_label(pad, Meta.PadActionType.BUTTON, i);
- labels.push(str ? str : '');
+ labels.push(str ?? '');
}
if (this._gsdWacomProxy) {
for (const windowInfo of this._windows.values()) {
const frame = windowInfo.metaWindow.get_frame_rect();
- frameRect = frameRect ? frameRect.union(frame) : frame;
+ frameRect = frameRect?.union(frame) ?? frame;
}
if (!frameRect)
}
_onCloneSelected(clone, time) {
- let wsIndex;
- if (this.metaWorkspace)
- wsIndex = this.metaWorkspace.index();
+ const wsIndex = this.metaWorkspace?.index();
Main.activateWindow(clone.metaWindow, time, wsIndex);
}
let dragEvent = {
x,
y,
- dragActor: this._cursorWindowClone ? this._cursorWindowClone : this._dummy,
+ dragActor: this._cursorWindowClone ?? this._dummy,
source: this,
targetActor: pickedActor,
};